---
id: auth-signin
title: "auth.signIn()"
slug: auth-signin
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Log in an existing user, or login via a third-party provider.

<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { user, error } = await supabase.auth.signIn({
  email: 'example@email.com',
  password: 'example-password',
})
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

## Parameters


<ul className="method-list-group">
  
<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      credentials
    </span>
    <span className="method-list-item-label-badge required">
      required
    </span>
    <span className="method-list-item-validation">
      object
    </span>
  </h4>
  <div class="method-list-item-description">

The user login details.
  
  </div>
  
<ul className="method-list-group">
  <h5 class="method-list-title method-list-title-isChild expanded">Properties</h5>

<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      email
    </span>
    <span className="method-list-item-label-badge false">
      optional
    </span>
    <span className="method-list-item-validation">
       | 
    </span>
  </h4>
  <div class="method-list-item-description">

The user's email address.
  
  </div>
  
</li>


<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      password
    </span>
    <span className="method-list-item-label-badge false">
      optional
    </span>
    <span className="method-list-item-validation">
       | 
    </span>
  </h4>
  <div class="method-list-item-description">

The user's password.
  
  </div>
  
</li>


<li className="method-list-item">
  <h4 className="method-list-item-label">
    <span className="method-list-item-label-name">
      provider
    </span>
    <span className="method-list-item-label-badge false">
      optional
    </span>
    <span className="method-list-item-validation">
      Provider
    </span>
  </h4>
  <div class="method-list-item-description">

One of the providers supported by GoTrue.
  
  </div>
  
</li>

</ul>

</li>

</ul>


## Notes

- A user can sign up either via email or OAuth.
- If you provide `email` without a `password`, the user will be sent a magic link.
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
- Specifying a `provider` will open the browser to the relevant login page.










## Examples

### Sign in with email.



<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { user, error } = await supabase.auth.signIn({
  email: 'example@email.com',
  password: 'example-password',
})
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

### Sign in with magic link.

If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.

<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { user, error } = await supabase.auth.signIn({
  email: 'example@email.com'
})
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

### Sign in using third-party providers.

Supabase supports OAuth logins.

<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { user, error } = await supabase.auth.signIn({
  // provider can be 'github', 'google', 'gitlab', or 'bitbucket'
  provider: 'github'
})
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>